﻿using System;
using Lidgren.Network;
using Fusion.Management;
using Client.Game_States;

namespace Client
{
    public static class Network
    {
        // Data Members
        private static ClientSocket socket = new ClientSocket();

        // Member Properties
        public static ClientSocket Socket
        {
            get { return socket; }
            private set { socket = value; }
        }

        // Methods
        public static void Listen()
        {
            Socket.Listen();
        }
        public static void SendData(NetOutgoingMessage Packet)
        {
            Socket.SendData(Packet);
        }
        public static bool IsConnected()
        {
            return Socket.IsConnected();
        }
        public static bool DiscoverServer()
        {
            return Socket.DiscoverServer();
        }
        public static NetOutgoingMessage CreatePacket()
        {
            return Socket.CreatePacket();
        }
        public static NetOutgoingMessage CreatePacket(int Capacity)
        {
            return Socket.CreatePacket(Capacity);
        }
        public static void ErrorMessage(string Message)
        {
            FStates.PushState(new ErrorState(Message));
        }
        public static void Close()
        {
            Socket.Close();
        }
    }
}
